package com.jingfu.common;


import org.springframework.http.HttpStatus;
import org.zalando.problem.AbstractThrowableProblem;
import org.zalando.problem.Status;
import org.zalando.problem.StatusType;

import javax.print.DocFlavor;
import java.net.URI;

/**
 * 自定义的业务异常，全部映射成 HTTP STATUS 400 BadRequet
 * @author jingfuu@163.com
 * @version v1.0
 * @date 2022/1/15 下午6:15
 **/
public class BadRequestException extends AbstractThrowableProblem {
    private static final URI TYPE
            = URI.create("https://com.jingfu/bad-request");
    public BadRequestException(ErrorCode errorCode) {
        super(TYPE,errorCode.name(),ErrorCode.BAD_REQUEST ,errorCode.getReasonPhrase());
    }

    public BadRequestException(String errorTitle,String errorMsg) {
        super(TYPE,errorTitle,ErrorCode.BAD_REQUEST ,errorMsg);
    }
}
